
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>待生产订单</title>
    <link rel="stylesheet" href="/static/js/elementui/index.css">
</head>
<body>
<div id="app">
    <!--查询-->
    <el-form :inline="true" :model="order" class="demo-form-inline">
        <el-form-item label="查询待生产订单: ">
            <el-input v-model="order.id" size="mini" placeholder="输入订单编号"></el-input>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" size="mini" icon="el-icon-search" @click="onSubmit">查询</el-button>
        </el-form-item>
    </el-form>
    <!--表格-->
    <template>
        <el-table
                :data="tOrder"
                border
                style="width: 100%">
            <el-table-column
                    prop="id"
                    label="订单id"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="orderId"
                    label="订单编号"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="pname"
                    label="产品名称"
                    width="180">
            </el-table-column>
            <el-table-column
                    prop="productId"
                    label="产品型号">
            </el-table-column>
            <el-table-column
                    prop="number"
                    label="生产数量">
            </el-table-column>
            <el-table-column
                    prop="productionName"
                    label="生产产线">
            </el-table-column>
            <el-table-column
                    prop="printer"
                    label="使用打印机">
            </el-table-column>
            <el-table-column
                    prop="productTime"
                    label="生产时间">
            </el-table-column>
            <el-table-column
                    prop="allStatus"
                    label="生产状态">
            </el-table-column>
            <el-table-column
                    prop="remark"
                    label="备注">
            </el-table-column>
            <el-table-column label="操作">
                <template slot-scope="scope">
                    <el-button
                            type="primary"
                            size="mini"
                            @click="roleEdit(scope.$index,scope.row)">加入到激光码生产列表</el-button>
                </template>
            </el-table-column>
        </el-table>
    </template>
</div>
<script src="/static/js/vue/vue.js"></script>
<script src="/static/js/axios/axios.min.js"></script>
<script src="/static/js/qs/qs.min.js"></script>
<!-- 引入组件库 -->
<script src="/static/js/elementui/index.js"></script>
<script>
    new Vue({
        el:'#app',
        data(){
            return{
                tOrder:null,
                order:{
                    id:'',
                }
            }
        },
        methods:{
            //查询
            onSubmit(){
                console.log(this.order.id);
                axios.get("/tOrder/",this.order.id).then(value => {
                    if (value.data.code==1){
                    this.tOrder=value.data.data;
                }
            })
            },
            //查询所有
            selectAllOrder(){
                axios.get("/tOrder").then(value => {
                    if (value.data.code==1){
                    this.tOrder=value.data.data;
                }
            })
            }
        },
        mounted(){
            this.selectAllOrder();
        }
    })
</script>
</body>
</html>